package org.xdq.demo.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.xdq.demo.dto.EmpDto;
import org.xdq.demo.dto.EmpQueryDto;
import org.xdq.demo.model.Emp;

import java.util.List;

public interface EmpDao {

    public List<Emp> findEmpList(EmpQueryDto dto);

    @Select("select ifnull(max(convert(e_id,signed)),0) from t_emp")
    public int findMaxIntegerId();

//    @Insert("insert into t_emp(e_id,e_name,e_sex,e_birth,d_id,e_status) " +
//            "values(#{e_id},#{e_name},#{e_sex},#{e_birth},#{d_id},#{e_status})")
    public void insertNewEmp(EmpDto empDto);

//    @Update("update t_emp \n" +
//            "set e_name = #{e_name},e_sex = #{e_sex},e_birth = #{e_birth},d_id = #{d_id},e_status = #{e_status} \n" +
//            "where e_id = #{e_id}")
    public void updateEmp(EmpDto empDto);

    @Delete("delete from t_emp where e_id = #{id}")
    public void deleteEmpById(String e_id);

    void deleteEmpByIds(@Param("ids") String[] ids);
}
